#include<stdio.h>
#include<stdlib.h>

#include<string.h>
struct stu
{
	char name[20];
	int year; 
};
int cmp_struct(const void*e1,const void*e2)
{
	return strcmp(((struct stu*)e1)->name,((struct stu*)e2)->name); 
}

int main()
{
	struct stu p1[]={ {"houmula",500},{"guang",500} };
	int sz=sizeof(p1)/sizeof(p1[0]);
	qsort(p1,sz,sizeof(p1[0]),cmp_struct);
 	 
	return 0;
}
